package com.jishuo.nontax.bean.vo;

import com.jishuo.base.util.StringObject;
import com.jishuo.nontax.bean.bank.PayDivide;
import com.jishuo.nontax.bean.message.SetBankPayDivide;
import com.jishuo.nontax.bean.message.SetPayDivide;
import com.jishuo.nontax.bean.message.SetPayDivideNew;

import lombok.Data;

import java.math.BigDecimal;

/**
 * @auther dinggaofei
 * @Date 2023/2/7 8:46
 * @tableName T_FSPAYDIVIDE 划解分成表
 */
@SuppressWarnings("serial")
@Data
public class PayDivideVO {

    //流水号
    private Long payid;
    //票据号
    private String dividebillnum;
    //行政区划
    private Long cantonid;
    //单位ID
    private Long unitid;
    //目标单位ID
    private Long parentunitid;
    //项目id
    private Long itemid;
    //项目编码
    private String itemcode;
    //项目分成金额
    private BigDecimal itemmoney;
    //付款账户ID
    private Long payerbankid;
    //收款帐户ID
    private Long payeebankid;
    //是否银行确认划款
    private Integer isbankaffirm;
    //银行交易流水号
    private String bankaffirm;
    //银行划款时间
    private String paybankdt;
    //银行网点
    private String bankstation;
    //单据状态
    private Integer billstate;
    //
    private Integer issend;
    //
    private Long messageid;
    //打印时间
    private String writedate;
    //发送时间
    private String sendtime;
    //银行核心交易流水号
    private String hxbankaffirm;
    //项目名称
    private String itemname;
    //行政区划名称
    private String cantonname;
    //行政区划编码
    private String cantoncode;
    //账户
    private String accountcode;
    //账户名称
    private String accountname;
    //银行名称
    private String bankname;
    //单位编码
    private String unitcode;
    //单位名称
    private String unitname;
    //账户
    private String yaccountcode;
    //账户名称
    private String yaccountname;
    //银行名称
    private String ybankname;
    //单位编码
    private String yunitcode;
    //单位名称
    private String yunitname;


    //页面
    private String payercantonid;
    private String payercantoncode;
    private String payercantonname;
    private String payerbankname;
    private String payeraccountname;
    private String payeraccountcode;
    private String payerunitcode;
    private String payerunitname;
    private String payeebankname;
    private String payeeaccountname;
    private String payeeaccountcode;


    //返回payDivide类
    public PayDivide getPayDivide() {
        PayDivide divide = new PayDivide();

        divide.setPayid(StringObject.objectString(this.payid));
        divide.setDividebillnum(this.dividebillnum);
        divide.setCantonid(StringObject.objectString(this.cantonid));
        divide.setCantoncode(this.cantoncode);
        divide.setCantonname(this.cantonname);
        divide.setUnitid(StringObject.objectString(this.unitid));
        divide.setUnitcode(this.unitcode);
        divide.setUnitname(this.unitname);
        divide.setParentunitid(StringObject.objectString(this.parentunitid));
        divide.setParentunitcode(this.yunitcode);
        divide.setParentunitname(this.yunitname);
        divide.setItemid(StringObject.objectString(this.itemid));
        divide.setItemcode(this.itemcode);
        divide.setItemname(this.itemname);
        divide.setMoney(StringObject.objectString(this.itemmoney));
        divide.setPayerbankid(StringObject.objectString(this.payerbankid));
        divide.setAccountcode(this.accountcode);
        divide.setBankname(this.bankname);
        divide.setAccountcode(this.accountcode);
        divide.setPayeebankid(StringObject.objectString(this.payeebankid));
        divide.setPayeeaccountcode(this.yaccountcode);
        divide.setPayeeaccountname(this.yaccountname);
        divide.setPayeebankname(this.ybankname);

        return divide;
    }

    //返回SetbankPayDivide类
    public SetBankPayDivide setDividePayInfo() {
        SetBankPayDivide divide = new SetBankPayDivide();
        divide.setPayid(StringObject.objectString(this.payid));
        divide.setDividebillnum(this.dividebillnum);
        divide.setCantonid(StringObject.objectString(this.cantonid));
        divide.setUnitid(StringObject.objectString(this.unitid));
        divide.setParentunitid(StringObject.objectString(this.parentunitid));
        divide.setItemid(StringObject.objectString(this.itemid));
        divide.setMoney(StringObject.objectString(this.itemmoney));
        divide.setParentunitid(StringObject.objectString(this.parentunitid));
        divide.setPayerbankid(StringObject.objectString(this.payerbankid));
        divide.setBankaffirm(this.bankaffirm);
        divide.setPaybankdt(this.paybankdt);
        divide.setBankstation(this.bankstation);
        return divide;
    }

    public PayDivideVO() {
    }

    //从SetPayDivide获取数据
    public PayDivideVO(SetPayDivide divide) {
        this.payid = Long.parseLong(divide.getPayid());
        this.dividebillnum = divide.getDividebillnum();
        this.cantonid = Long.parseLong(divide.getCantonid());
        this.unitid = Long.parseLong(divide.getUnitid());
        this.parentunitid = Long.parseLong(divide.getParentunitid());
        this.itemid = Long.parseLong(divide.getItemid());
        this.itemmoney = new BigDecimal(divide.getMoney());
        this.payerbankid = Long.parseLong(divide.getPayerbankid());
        this.payeebankid = Long.parseLong(divide.getPayeebankid());
    }

    //从SetPayDivide获取数据
    public PayDivideVO(SetPayDivideNew divide) {
        this.payid = Long.parseLong(divide.getPayid());
        this.dividebillnum = divide.getDividebillnum();
        this.cantonid = Long.parseLong(divide.getCantonid());
        this.unitid = Long.parseLong(divide.getUnitid());
        this.parentunitid = Long.parseLong(divide.getParentunitid());
        this.itemid = Long.parseLong(divide.getItemid());
        this.itemmoney = new BigDecimal(divide.getMoney());
        this.payerbankid = Long.parseLong(divide.getPayerbankid());
        this.payeebankid = Long.parseLong(divide.getPayeebankid());
//        this.itemcode = divide.getItemcode();
//        this.itemname = divide.getItemname();
    }
}
